// 基础消息类型
export interface Message {
  id: string
  role: 'user' | 'assistant' | 'system'
  content: string
  timestamp: string
  metadata?: Record<string, any>
  ragContext?: Array<{
    id: string
    content: string
    score: number
    metadata?: Record<string, any>
  }>
}

// 聊天配置类型
export interface ChatConfig {
  model: string
  temperature: number
  maxTokens: number
  topP?: number
  systemPrompt?: string
  useRAG?: boolean
  useTools?: boolean
}

// Excel文件类型
export interface ExcelFile {
  id: string
  name: string
  url: string
  createdAt: string
  size?: number
}

// API响应基础类型
export interface ApiResponse<T = any> {
  success: boolean
  data?: T
  error?: string
  message?: string
}

// 会话类型
export interface Session {
  id: string
  title: string
  createdAt: string
  updatedAt: string
  messageCount: number
}

// 用户类型
export interface User {
  id: string
  username: string
  email?: string
  avatar?: string
  createdAt: string
}

// 认证相关类型
export interface LoginRequest {
  username: string
  password: string
}

export interface LoginResponse {
  token: string
  user: User
  expiresIn: number
}

// SSE事件类型
export interface SSEEvent {
  type: 'chunk' | 'error' | 'done'
  content?: string
  data?: any
}